package com.mdxq.mall.sale.service.impl;

import com.mdxq.mall.sale.entity.HomeRecommendSubject;
import com.mdxq.mall.sale.mapper.HomeRecommendSubjectMapper;
import com.mdxq.mall.sale.service.HomeRecommendSubjectService;
import com.mybatisflex.spring.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * 首页推荐专题表 服务层实现。
 *
 * @author ShuJie
 * @since 2025-01-12
 */
@Service
public class HomeRecommendSubjectServiceImpl extends ServiceImpl<HomeRecommendSubjectMapper, HomeRecommendSubject>  implements HomeRecommendSubjectService{

    @Override
    @Transactional
    public boolean updateRecommendStatus(String ids, Integer recommendStatus) {
        for(String id:ids.split(",")){
            HomeRecommendSubject subject=getById(id);
            subject.setRecommendStatus(recommendStatus);
            updateById(subject);
        }
        return true;
    }
}
